#include "Game.h"
#include "ModeGame.h"

using namespace GTL;
using namespace GTL::Engine;

int TowerGame::StartGame()
{
	SetNext('game');

	return 0;
}

Mode* TowerGame::CreateMode( int id, int arg1, int arg2 )
{
	switch (id)
	{
	case 'game':
		return AutoMembers::Producible::Produce<ModeGame>();
	}
	return 0;
}

void Reflector::Read( int& v )
{
	fscanf(File, "%i", &v);
}

void Reflector::Read( float& v )
{
	fscanf(File, "%f", &v);
}

void Reflector::Write( int& v )
{
	fprintf(File, "%i ", v);
}

void Reflector::Write( float& v )
{
	fprintf(File, "%f ", v);
}

void Reflector::Start( int mode, const char* filename )
{
	if (File)
	{
		fclose(File);
		File = 0;
	}

	File = fopen(filename, mode==REF_Deserializing?"r":"w");
	Mode = mode;
}